//package com.ants.platform.core.plugins.jms;
//
//import org.springframework.beans.factory.InitializingBean;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.jms.core.JmsTemplate;
//import org.springframework.jms.core.MessageCreator;
//import org.springframework.stereotype.Repository;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import javax.jms.Destination;
//import javax.jms.JMSException;
//import javax.jms.Message;
//import javax.jms.Session;
//
///**
// * 需要配置文件spring jms 注入jmsTemplate
// * === activemq 消息队列框架 ====
// * <dependency>
// * <groupId>org.apache.activemq</groupId>
// * <artifactId>activemq-all</artifactId>
// * <version>5.13.4</version>
// * </dependency>
// * Created by liushun on 2016/8/2.
// */
//@Service
//public class ProducerServiceImpl implements ProducerService, InitializingBean {
//
//    @Autowired
//    private JmsTemplate jmsTemplate;
//
//
//    /**
//     * 向指定队列发送消息
//     */
//    public void sendMessage(Destination destination, final String msg) {
//        System.out.println("向队列" + destination.toString() + "发送了消息------------" + msg);
//        jmsTemplate.send(destination, new MessageCreator() {
//            public Message createMessage(Session session) throws JMSException {
//                return session.createTextMessage(msg);
//            }
//        });
//    }
//
//    /**
//     * 向默认队列发送消息
//     */
//    public void sendMessage(final String msg) {
//        Destination destination = jmsTemplate.getDefaultDestination();
//        System.out.println("向队列" +destination+ "发送了消息------------" + msg);
//        jmsTemplate.send(new MessageCreator() {
//            public Message createMessage(Session session) throws JMSException {
//                return session.createTextMessage(msg);
//            }
//        });
//
//    }
//
//    @Override
//    public void afterPropertiesSet() throws Exception {
//        System.out.println("####################### 注入 成功");
//    }
//}